﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Sands.Common;
using Sands.Web;
using Sands.DataAccess;

namespace SAWeb.Web.Admin
{
    public partial class Left : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadMenu();
            }
        }

        protected void LoadMenu()
        {
            string url = Request.RawUrl;
            int iIndex = url.IndexOf("?");
            if (iIndex > 0) url = url.Substring(0, iIndex);
             MenuList list = MenuList.LoadMenu("MenuFile".GetConfigString());
            Repeater RptTopMenus = Page.FindControl("rptTopMenu") as Repeater;
            list.DataBind(RptTopMenus);
            for (int i = 0; i < list.Count; i++)
            {
                Repeater rpt = RptTopMenus.Items[i].FindControl("rptLeftMenu") as Repeater;
                list[i].SubItems.DataBind(rpt);
            };
        }
    }
}